//
//  VisitorTest.m
//  Charles
//
//  Created by Leo on 2019/7/15.
//  Copyright © 2019 charles. All rights reserved.
//

#import "VisitorTest.h"
#import "VisitorObjects.h"

@implementation VisitorTest

+ (void)visitorTest {
    VDirectory *rootdir = [[VDirectory alloc]initWithName:@"root"];
    VDirectory *bindir = [[VDirectory alloc]initWithName:@"bin"];
    VDirectory *tmpdir = [[VDirectory alloc]initWithName:@"tmp"];
    VDirectory *usrdir = [[VDirectory alloc]initWithName:@"usr"];
    
    [rootdir add:bindir];
    [rootdir add:tmpdir];
    [rootdir add:usrdir];
    
    VFile *vi = [[VFile alloc]initWithName:@"vi" size:10000];
    [bindir add:vi];
    
    VFile *latex = [[VFile alloc]initWithName:@"latex" size:20000];
    [bindir add:latex];
    
    ListVisitor *listVisitor = [[ListVisitor alloc]init];
    [rootdir accept:listVisitor];
    
    NSLog(@"********************************");
    
    [rootdir printList];

}

@end
